<?php
namespace app\core;

use Throwable;
use Exception;
// function exception_error_handler($severity, $message, $file, $line) {
//     if (!(error_reporting() & $severity)) {
//         // This error code is not included in error_reporting
//         return;
//     }
//     throw new ErrorException($message, 0, $severity, $file, $line);
// }
// set_error_handler("exception_error_handler");
class HttpException
{
    public static function handdle(Throwable $e)
    {

        
        if ($e instanceof Exception) {
            $dt = date("Y-m-d");
            $dtError = date("Y-m-d H:i:s");
            $message = "[{$dtError}]{$e->getMessage()} {$e->getFile()} {$e->getLine()}";
            error_log($message , 3, LOG . "{$dt}.exception.log");
        }
      
        return true;
    }
}
